﻿project(mms-demo)

cmake_minimum_required(VERSION 2.8)

add_definitions(-D MMS)
include_directories(${DEMO_ROOT_DIR}/mms/header)
include_directories(${DEMO_ROOT_DIR}/include)
include_directories(${DEMO_ROOT_DIR}/include/mms)

LINK_DIRECTORIES(${LINK_DIR_FOR_PIS})

add_executable(mms-server ../mms/source/IEC61850Functions.c
                      ../mms/source/LocalData.c
                      ../mms/source/MainServer.c
                      ../mms/source/PIS10CreateServerClient.c
                      ../mms/source/PIS10Callbacks.c
                      ../mms/source/PrintView.c
                      ../mms/source/UserInput.c)
target_link_libraries(mms-server mms-ctk)

add_executable(mms-client ../mms/source/IEC61850Functions.c
                      ../mms/source/LocalData.c
                      ../mms/source/MainClient.c
                      ../mms/source/PIS10CreateServerClient.c
                      ../mms/source/PIS10Callbacks.c
                      ../mms/source/PrintView.c
                      ../mms/source/UserInput.c)
target_link_libraries(mms-client mms-ctk)

add_executable(mms-server-sub ../mms/source/IEC61850Functions.c
                      ../mms/source/LocalData.c
                      ../mms/source/MainServerSubscription.c
                      ../mms/source/PIS10CreateServerClient.c
                      ../mms/source/PIS10Callbacks.c
                      ../mms/source/PrintView.c
                      ../mms/source/UserInput.c)
target_link_libraries(mms-server-sub mms-ctk)

if(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/mms-ctk.dll)
    file(COPY ${LINK_DIR_FOR_PIS}/mms-ctk.dll DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
endif()

